<template>
    <div class="app-2">
        <h1>{{ hello }}</h1>
        <h1>{{ count }}</h1>
        <button @click="count++">count++</button>
        <!-- <hello-world msg="hello world"></hello-world> -->
        <!-- <message text="message-text" @change="showAlert"></message> -->
        <message :user="user" @change="showAlert"></message>
    </div>
</template>

<script setup lang="ts">
import {ref} from 'vue';
// import HelloWorld from './components/HelloWorld.vue'
import Message from './components/Message.vue'

const hello = 'hello world';
const count = ref(0);
// const showAlert = (text: string) => {
//     alert(text);//接收子组件传来的数据
// }
const showAlert = (age: number) => {
    alert(age);//接收子组件传来的数据
}

const user = {
    name:'wmh',
    age:23
}
</script>
<style scoped></style>